{% extends "menu.html" %}
{% block content %}

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">



            </div>
            <div class="clearfix"></div>
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>查询</h2>

                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br />
                    <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 选择项目<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select style="margin-top: 5px;width: 60%;height: 30px" name="project_id">
                          {% if project_id %}
                               <option value="{{ project_id }}">{{ project_name }}</option>
                              {% for project in user_project_list %}
                              <option value="{{ project.id }}">{{ project.p_name }}</option>
                              {% endfor %}
                          {% else %}
                                {% for project in user_project_list %}
                              <option value="{{ project.id }}">{{ project.p_name }}</option>
                              {% endfor %}
                          {% endif %}
                          </select>
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 开始时间<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="date" name="s_time_start">
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 结束时间<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="date" name="s_time_end">
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"><span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <span> 查询指定天的文需要跨天,eg:查询2018-11-15号的文件2018-11-15----2018-11-16</span>
                        </div>
                      </div>


                        <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <span>{{ result }}</span>
                        </div>
                      </div>
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button class="btn btn-primary" type="button">Cancel</button>
						  <button class="btn btn-primary" type="reset">Reset</button>
                          <button type="submit" class="btn btn-success">Submit</button>
                        </div>
                      </div>

                    </form>
                  </div>
                </div>
                  <div class="x_panel">
                  <div class="x_title">
                    <h2>文件列表</h2>

                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br />
                    <table class="sui-table table-bordered">
                          <thead>
                            <tr>
                                <th>文件名</th>
                                <th>下载地址</th>
                                <th>MD5 </th>
                                <th>所属项目 </th>
                                <th>上传时间</th>
                                <th>上传者</th>


                            </tr>
                          </thead>
                          <tbody>
                          <style type="text/css">
                             tr:hover{
                                 background-color: #FFFFE0;
                             }
                          </style>
                          {% for i in file_list %}
                            <tr>

                                <td>{{ i.file_name}}</td>
                                <td><a href="{{ i.file_url }}">{{ i.file_url }}</a> </td>
                                <td>{{ i.file_md5 }}</td>
                                <td>{{ i.file_project__p_name }}</td>
                                <td>{{ i.file_uptime }}</td>
                                <td>{{ i.file_owner__user_name }}</td>

                            </tr>
                        {% endfor %}
                          </tbody>
                      </table>
                  </div>
                </div>
              </div>
            </div>


          </div>
        </div>
{% endblock %}